# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Thomas Arnhold <thomas at arnhold dot org>

pkgname=liborcus
pkgver=0.19.2
pkgrel=1
pkgdesc="File import filter library for spreadsheet documents."
arch=('loong64' 'x86_64')
url="https://gitlab.com/orcus/orcus/blob/master/README.md"
license=('MPL')
depends=('libixion' 'glibc' 'boost-libs' 'gcc-libs' 'zlib' 'python')
makedepends=('boost' 'mdds')
optdepends=('python-requests: in tool bugzilla')
source=(https://kohei.us/files/orcus/src/${pkgname}-${pkgver}.tar.xz
liborcus-cstdint.patch)
# https://gitlab.com/orcus/orcus/-/releases
sha256sums=('69ed26a00d4aaa7688e62a6e003cbc81928521a45e96605e53365aa499719e39'
            '8e64a22ffaec4dbd5e7055c58b9cce209038130de01369829f40be55b4a9e29d')

prepare() {
    cd "${pkgname}"-${pkgver}
    patch -p1 -i $srcdir/liborcus-cstdint.patch
}

build() {
    cd "${pkgname}"-${pkgver}
    ./configure --prefix=/usr
    sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
    make
}

check() {
    cd "${pkgname}"-${pkgver}
    make check
}

package() {
    cd "${pkgname}"-${pkgver}
    make DESTDIR="$pkgdir" install
}
